<template>
	<clipBar></clipBar>
	<view class="mine_page">
		<button class="button" @tap="canDrawOverlaysFn">判断悬浮窗权限</button>
		<button class="button" @tap="wakeupAndUnlockFn">点亮解锁手机屏幕</button>
		<button class="button" @tap="setTopAppFn">应用切换到前台</button>
		<button class="button" @tap="clearToken">清理令牌缓存</button>
	</view>
	<clipTabbar curIndex="1"></clipTabbar>
</template>

<script setup>
	import {
		canDrawOverlays,
		setTopApp,
		wakeupAndUnlock
	} from "@/utils/remindFn.js"


	function canDrawOverlaysFn() {
		canDrawOverlays()
	}
	//将自身应用从后台切换到前台；如果应用进程被杀掉了，则命令无效。
	function setTopAppFn() {
		//点击按钮后，迅速将App手动置于后台即可
		setTimeout(() => {
			console.log('????')
			setTopApp()
		}, 3000);
	}
	//点击按钮后，迅速锁屏即可
	function wakeupAndUnlockFn() {
		setTimeout(() => {
			console.log('亮屏了')
			wakeupAndUnlock()
		}, 5000);
	}

	function clearToken() {
		uni.removeStorageSync('token');
	}
</script>

<style>
</style>